//
//  SXZHNewsMainCell.m
//  ShiXun
//
//  Created by lanou on 15/10/28.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXZHNewsMainCell.h"

@implementation SXZHNewsMainCell
- (void)setConfigureModel:(SXZHNewsMainModel *)configureModel
{
    _configureModel = configureModel;
    _titleLabel.text = configureModel.title;
    _titleLabel.frame = CGRectMake(12.5, 15, kScreenWidth - 30, [SXZHNewsMainCell heightOfString:configureModel.title]);
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(12.5, 15, kScreenWidth - 30, 25)];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}
+ (CGFloat)heightOfString:(NSString *)labelText
{
    CGRect bounds = [labelText boundingRectWithSize:CGSizeMake(kScreenWidth - 30, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:15] forKey:NSFontAttributeName] context:nil];
    return bounds.size.height;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
